#include <stdio.h>
#include "nummeths.h"

double fct(double x)
{
  return (x*x*x) -(x*x) - (3*x) + 1.8;
}

double d_fct(double x)
{
  return (3*x*x) - (2*x) - 3.0;
}

int main()
{
  double x[10];
  int nb = 10;

  x[0] = -2;

  root(fct, d_fct, x, &nb, 0.0001);

  printf("%f\n", x[nb-1]);
} 
